/*
 * The MiniQt Library
 *
 * Copyright (C) 1999 Sandro Sigala <ssigala@globalnet.it>
 */

#ifndef QSTRING_H
#define QSTRING_H

#include <stddef.h>

#include "qminiqt.h"

class QString {
public:
	QString();
	QString(const QString& copy);
	QString(const char *copy);
	~QString();

	size_t length();
	size_t size();

	const char *c_str() const;
	operator const char *() const;
	QString& sprintf(const char *fmt, ...);

	QString& operator =(const QString& copy);
	QString& operator +=(const QString& append);

private:
	char *data;
	size_t datalen;
	size_t datamaxlen;

	void initData(size_t size);
};

QString operator +(const QString& s1, const QString& s2);
QString operator +(const char *s1, const QString& s2);
QString operator +(const QString& s1, const char *s2);
bool operator ==(const QString& s1, const QString& s2);
bool operator ==(const char *s1, const QString& s2);
bool operator ==(const QString& s1, const char *s2);

#endif // !QSTRING_H
